package cn.tedu.egweb01.controller;

import cn.tedu.egweb01.Mapper.CustomersMapper;
import cn.tedu.egweb01.pojo.entity.Customers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class CustomersController {
    @Autowired
    private CustomersMapper customersMapper;
    @RequestMapping("/test/insertCustomers")
    @ResponseBody
    public String insertCustomers(Customers customers){
        return "您成功添加了"+customersMapper.insertCustomers(customers) + "条员工信息";
    }

    @RequestMapping("/test/updateCustomers")
    @ResponseBody
    public String dynamicUpdateCustomers(Customers customers){
        return "您成功修改了"+customersMapper.dynamicUpdateCustomers(customers) + "条员工信息";
    }
    @RequestMapping("/test/deleteCustomersById")
    @ResponseBody
    public String deleteCustomersById(String cId){
        return "您成功删除了"+customersMapper.deleteCustomersById(cId) + "条员工信息";
    }
}
